namespace SimpleWebServices.Web.UI.Html.Validation
{
    using SimpleWebServices;
    using Xunit;

    public sealed class ErrorFacts
    {
        [Fact]
        public void typedef()
        {
            Assert.True(new ObjectExpectations<Error>()
                .DerivesFrom<object>()
                .IsConcreteClass()
                .IsSealed()
                .HasDefaultConstructor()
                .Implements<IError>()
                .Result);
        }

        [Fact]
        public void ctor()
        {
            Assert.NotNull(new Error());
        }

        [Fact]
        public void ctor_string()
        {
            Assert.NotNull(new Error("description"));
        }

        [Fact]
        public void ctor_stringEmpty()
        {
            Assert.NotNull(new Error(string.Empty));
        }

        [Fact]
        public void ctor_stringNull()
        {
            Assert.NotNull(new Error(null));
        }

        [Fact]
        public void prop_Description()
        {
            Assert.True(new PropertyExpectations(typeof(Error).GetProperty("Description"))
                .IsAutoProperty<string>()
                .Result);
        }
    }
}